<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>study</title>
    <script src="js/jquery-3.3.1.min.js"></script>
</head>
<body>
<div id="div1">div1....</div>
<br>
<div id="div2">div2....</div>
<br>
<script>
    //使用jQuery
    var $divs = $("div");
    //可以当做数组来使用$divs
    alert($divs.length);
    /*
    * 对比JavaScript的数组遍历修改
    * javaScript
    * var divs = document.getElementsByTagName("div");
    * for(var i = 0; i<divs.length;i++){
    *    // div[i].innerHTML = "aaa";
    *     $(divs[i]).html("ccc");
    * }
    * */
    $divs.html("bbb");
    $divs[0].innerHTML = ("addada");
    $divs.get(1).innerHTML = ("addasssda");
</script>

</body>
</html>